//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#if !defined (__KEYPAD_H__)
#define __KEYPAD_H__

#define SYNCHRONIZATION  0
#define ASYNCHRONISM     1

typedef struct KPD_DATA {
    unsigned long keycode;
    unsigned long status;
} KPD_DATA;

// keypad status
#define KEYDOWN ((unsigned long)(1UL << 31))
#define KEYUP   (0)

class CKeypad : public Driver {
public:
    CARAPI Read(
        /* [in] */ UINT64 u64Offset,
        /* [in] */ UINT uNumberOfBytesToRead,
        /* [out] */ EzByteBuf ebbData,
        /* [out] */ IEvent * * ppCompletionEvent);

    CARAPI Write(
        /* [in] */ UINT64 u64Offset,
        /* [in] */ EzByteBuf ebbData,
        /* [out] */ UINT * puNumberOfBytesWritten,
        /* [out] */ IEvent * * ppCompletionEvent);

    CARAPI Control(
        /* [in] */ INT nControlCode,
        /* [in] */ EzByteBuf ebbInData,
        /* [out] */ EzByteBuf ebbOutData,
        /* [out] */ IEvent * * ppCompletionEvent);

    virtual void Dispose();

    ECode Initialize();

public :
        ULONG RefCnt;
};

#endif
